fix: code review fixes for stale files#430
Open
JiayangLai wants to merge 1 commit intobirdayz:masterfrom
Open
Conversation
- confluent_cloud.go: Fix variable shadowing (homedir -> home) and inconsistent error message capitalization - subscription_info.go: Add validation for negative array lengths to prevent potential panics - decoder.go: Remove commented-out code, fix getArrayLength to properly validate negative values, remove unused math import - schema.go: Replace magic number 0x00 with named constant - proto.go: Improve exclusion and deduplication logic using maps for O(1) lookups instead of O(n²) nested loops
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Code review fixes for the 5 least recently updated files in the repository (last modified in 2020-2023):
Changes
pkg/config/confluent_cloud.go
homedirvariable tohometo avoid shadowing the importedhomedirpackagepkg/streams/subscription_info.go
numPrevsandnumStandby) to prevent potential integer overflow/panic when casting tointpkg/streams/decoder.go
getArrayLength()to properly validate negative values before the bounds checkmathimportpkg/avro/schema.go
0x00with named constantavroMagicBytefor better code claritypkg/proto/proto.go
map[string]struct{}for O(1) lookups instead of O(n²) nested loopsptoparserto avoid potential confusionTest Plan
go build ./...)